﻿using System;
using System.Linq;
using ASPNETVN.PORTAL.Components.UI;
using ASPNETVN.PORTAL.Modules.LINK.Components;

namespace ASPNETVN.PORTAL.Modules.LINK.Controls
{
    public partial class Style2 : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                cbLinks.Attributes.Add("onchange", "window.open(this.options[this.selectedIndex].value,'_blank');");
                cbLinks.DataSource = Item.SelectCollectionAll(this.ModuleID).OrderBy(x => x.SortOrder);
                cbLinks.DataTextField = "Title";
                cbLinks.DataValueField = "URL";
                cbLinks.DataBind();
            }
        }
    }
}